    <div class="list_category">
        <ul>
            <li><a href="<?php echo $this->baseUrl('admincp/product/create'); ?>">Tạo sản phẩm mới</a></li>
        </ul>
    </div>
</div>

<!-- Begin Content -->
<div class="section">
    <div class="heading_section">
        <span>Quản lý sản phẩm</span>
    </div>
    
    <div class="content">
    <p style="font-weight: bold; margin-left: 10px;">Tìm kiếm sản phẩm:</p>
        <form action="" method="get">
            <table class="search-form">
                <tr>
                    <td class="td1"><?php echo $this->formLabel('name','Tên sản phẩm:'); ?></td>
                    <td class="td2"><?php echo $this->formText('name',$this->keyword['name'],array('class'=>'input')); ?></td>
                    <td class="td1"><?php echo $this->formLabel('status','Trạng thái:'); ?></td>
                    <td class="td2"><?php echo $this->formSelect('status',$this->keyword['status'],
                        array(
                            'class'=>'selectbox',
                        ),
                        array(
                            '0'=>'----------------- Tất cả ------------------',
                            '1'=>'Hiển thị',
                            '2'=>'Ẩn đi',
                        )); ?></td>
                    <td class="search-button" rowspan="3">
                        <?php echo $this->formSubmit('submit','Tìm kiếm',array('class'=>'button')); ?>
                    </td>
                </tr>
                <tr>
                    <td class="td1"><?php echo $this->formLabel('category_id','Danh mục:'); ?></td>
                    <td class="td2">
                        <select name="category_id" id="category_id" class="selectbox">
                        <option value="0">----------------- Tất cả ------------------</option>
                        <?php
                            if(count($this->category) > 0) :
                                $category = new Admincp_Model_Category();
                                foreach($this->category as $value) :
        							$levelCss = '';
        				            if($value['level'] == 0){
        				            	continue;
        				            }else if($value['level'] == 1){
        				            	$name = $value['name'];
        				            }else{
        				            	$name = ' - - ' . $value['name'];
        				            	$levelCss =  'padding-left: ' . (10 * $value['level']) . 'px;';
        				            }
    			            ?>
                            <?php if($this->keyword['category_id'] == $value['id']) : ?>
                            <option selected="selected" value="<?php echo $value['id']; ?>" style="<?php echo $levelCss; ?>"><?php echo $name; ?></option>
                            <?php else : ?>
                            <option value="<?php echo $value['id']; ?>" style="<?php echo $levelCss; ?>"><?php echo $name; ?></option>
                            <?php endif; ?>
    						<?php
                                    endforeach;
                                endif;
                            ?>
                        </select>
                    </td>
                    <td class="td1"><?php echo $this->formLabel('provider_id','Thương hiệu:'); ?></td>
                    <td class="td2">
                        <select name="provider_id" id="provider_id" class="selectbox">
                        <option value="0">----------------- Tất cả ------------------</option>
                            <?php
                                if(count($this->provider) > 0) :
                                    foreach($this->provider as $value) :
                            ?>
                            <?php if($this->keyword['provider_id'] == $value['id']) : ?>
                            <option selected="selected" value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                            <?php else : ?>
                            <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
                            <?php endif; ?>
                            <?php
                                    endforeach;
                                endif;
                            ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="td1"><?php echo $this->formLabel('start_price','Giá tiền từ:'); ?></td>
                    <td class="td2"><?php echo $this->formText('start_price',$this->keyword['start_price'],array('class'=>'input','style'=>'width:150px; text-align: right')); ?>000 VNĐ</td>
                    <td class="td1"><?php echo $this->formLabel('end_price','Đến:'); ?></td>
                    <td class="td2"><?php echo $this->formText('end_price',$this->keyword['end_price'],array('class'=>'input','style'=>'width:150px; text-align: right')); ?>000 VNĐ</td>
                </tr>
            </table>
        </form>
        
        <form action="<?php echo $this->baseUrl('admincp/product'); ?>" method="post">
        <p style="float: right; margin-right: 15px">Tổng số: <?php echo $this->total; ?> kết quả</p><br/>
        <table class="list-records">
            <tr class="list-header">
                <td>Tên sản phẩm</td>
                <td style="width: 60px;">Ảnh</td>
                <td>Danh mục</td>
                <td>Thương hiệu</td>
                <td>Giá tiền (VNĐ)</td>
                <td width="70">Trạng thái</td>
                <td colspan="2">Tùy chọn</td>
                <td width="25"><?php echo $this->formCheckbox('check_all', null, array('id' => 'check_all', 'onClick' => 'checkAll()')); ?></td>
            </tr>
            <?php if(count($this->data) > 0) :
                $common = new Admincp_Model_Common();
                foreach($this->data as $value) : ?>
            <tr>
                <td><?php echo $value['name']; ?></td>
                <td style="text-align: center;"><img src="<?php echo $this->baseUrl('/public/files/product/thumbnail/').$value['thumbnail']; ?>" width="40px" height="40px" /></td>
                <td><?php echo $value['category_name']; ?></td>
                <td><?php echo $value['provider_name']; ?></td>
                <td style="text-align: right;"><?php echo $common->formatMoney($value['price'].'000'); ?></td>
                <td style="text-align: center;">
                    <a href="<?php echo $this->baseUrl('admincp/product/publish?id=').$value['id'].'&status='.$value['status']; ?>">
                    <?php if($value['status'] == '1') : ?>
                        <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/publish.png" />
                    <?php else : ?>
                        <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/unpublish.png" />
                    <?php endif; ?>
                    </a>
                </td>
                <td class="tools">
                    <a href="<?php echo $this->baseUrl('admincp/product/edit?id=').$value['id']; ?>">
                        <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/edit.png" />
                    </a>
                </td>
                <td class="tools">
                    <a href="<?php echo $this->baseUrl('admincp/product/delete?id=').$value['id']; ?>" onclick="return remove_alert()">
                        <img src="<?php echo $this->baseUrl(''); ?>public/templates/admin/images/remove.png" />
                    </a>
                </td>
                <td class="tools"><?php echo $this->formCheckbox('check[]', $value['id']); ?></td>
            </tr>
            <?php endforeach; ?>
            <?php else : ?>
            <tr>
                <td colspan="9" style="font-style: italic;">Không tìm thấy kết quả nào</td>
            </tr>
            <?php endif; ?>
        </table>
        
        <div class="list-bottom">
            <?php if(count($this->data) > 0) : ?>
            <div class="pagination">
                <?php
        	        $currentUrl = '/?name='.$this->keyword['name'].'&status='.$this->keyword['status'].'&submit=Tìm+kiếm&category_id='.$this->keyword['category_id'].'&provider_id='.$this->keyword['provider_id'].'&start_price='.$this->keyword['start_price'].'&end_price='.$this->keyword['end_price'];
        	        echo $this->paginationControl($this->data, 'Sliding', 'product/pagination_search.phtml', array('currentUrl' => $currentUrl));
                ?>
            </div>
            <?php endif; ?>
            
            <div class="list-buttons">
                <?php echo $this->formSubmit('add','Tạo mới',array('class'=>'button')); ?>
                <?php echo $this->formSubmit('refresh','Làm mới',array('class'=>'button')); ?>
                <?php echo $this->formSubmit('delete','Xóa',array('class'=>'button','onClick'=>'return remove_alert()')); ?>
            </div>
        </div>
        </form>
    </div>
</div>
<!-- End Content -->